<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="utf-8">
  <title th:text="${jie.title}"></title>
  <meta name="_csrf" th:content="${_csrf.token}"/>
  <meta name="_csrf_header" th:content="${_csrf.headerName}">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="keywords" content="fly,layui,前端社区">
  <meta name="description" content="Fly社区是模块化前端UI框架Layui的官网社区，致力于为web开发提供强劲动力">
  <link rel="stylesheet" th:href="@{/res/layui/css/layui.css}">
  <link rel="stylesheet" th:href="@{/res/css/global.css}">
</head>
<body>

<!-- 引入header -->
<div th:replace="common/header::bbsHeader"></div>
<div th:replace="common/column::bbsColumn(value='jie')"></div>

<div class="layui-container">
  <div class="layui-row layui-col-space15">
    <div class="layui-col-md8 content detail">
      <div class="fly-panel detail-box">
        <h1 th:text="${jie.title}"></h1>
        <div class="fly-detail-info">
          <!-- <span class="layui-badge">审核中</span> -->
          <span class="layui-badge layui-bg-green fly-detail-column" th:text="${jie.getColumn(jie.getColumnId())}">动态</span>
          
          <span class="layui-badge" style="background-color: #999;" th:if="${!jie.isClosed}">未结</span>
           <span class="layui-badge" style="background-color: #5FB878;" th:if="${jie.isClosed}">已结</span>
          
          <span class="layui-badge layui-bg-black" th:if="${jie.isSticky}">置顶</span>
          <span class="layui-badge layui-bg-red" th:if="${jie.isBoutique}">精帖</span>
          
          <div class="fly-admin-box" th:data-id="${jie.id}">
            <input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/>
            <span class="layui-btn layui-btn-xs jie-admin" type="del">删除</span>
            
            <span class="layui-btn layui-btn-xs jie-admin" type="set" field="stick" rank="1" th:if="${!jie.isSticky}">置顶</span>
            <span class="layui-btn layui-btn-xs jie-admin" type="set" field="stick" rank="0" style="background-color:#ccc;" th:if="${jie.isSticky}">取消置顶</span>
            
            <span class="layui-btn layui-btn-xs jie-admin" type="set" field="boutique" rank="1" th:if="${!jie.isBoutique}">加精</span>
            <span class="layui-btn layui-btn-xs jie-admin" type="set" field="boutique" rank="0" style="background-color:#ccc;" th:if="${jie.isBoutique}">取消加精</span>
          </div>
          <span class="fly-list-nums"> 
            <a href="#comment"><i class="iconfont" title="回答">&#xe60c;</i> [[${jie.commentCount}]]</a>
            <i class="iconfont" title="人气">&#xe60b;</i> [[${jie.viewCount}]]
          </span>
        </div>
        <div class="detail-about">
          <a class="fly-avatar" href="../user/home.html">
            <img src="https://tva1.sinaimg.cn/crop.0.0.118.118.180/5db11ff4gw1e77d3nqrv8j203b03cweg.jpg" alt="贤心">
          </a>
          <div class="fly-detail-user">
            <a href="../user/home.html" class="fly-link">
              <cite th:text="${jie.creator.name}"></cite>
              <i class="iconfont icon-renzheng" th:title="${'认证信息：'+jie.creator.name}"></i>
              <i class="layui-badge fly-badge-vip" th:text="${jie.creator.userGrade.gradeName}"></i>
            </a>
            <span>[[${#dates.format(jie.gmtCreate, 'yyyy-MM-dd HH:mm')}]]</span>
          </div>
          <div class="detail-hits" id="LAY_jieAdmin" data-id="123">
<!--            <span style="padding-right: 10px; color: #FF7200">悬赏：60飞吻</span>  -->
            <span class="layui-btn layui-btn-xs jie-admin" type="edit"><a th:href="@{'/jie/edit/'+${jie.id}(callback=${jie.projectId})}">编辑此贴</a></span>
          </div>
        </div>
        <div class="detail-body photos" th:text="${jie.content}">
        </div>
      </div>

      <div class="fly-panel detail-box" id="flyReply">
        <fieldset class="layui-elem-field layui-field-title" style="text-align: center;">
          <legend>回帖</legend>
        </fieldset>

        <ul class="jieda" id="jieda">
          <li th:if="${#lists.size(jieReplies ) > 0}" th:data-id="${jieReply.id}" class="jieda-daan" th:each="jieReply : ${jieReplies}">
            <a name="item-1111111111"></a>
            <div class="detail-about detail-about-reply">
              <a class="fly-avatar" href="">
                <img src="https://tva1.sinaimg.cn/crop.0.0.118.118.180/5db11ff4gw1e77d3nqrv8j203b03cweg.jpg" alt=" ">
              </a>
              <div class="fly-detail-user">
                <a href="" class="fly-link">
                  <cite th:text="${jieReply.creator.name}">贤心</cite>
                  <i class="iconfont icon-renzheng" title="认证信息：XXX"></i>
                  <i class="layui-badge fly-badge-vip" th:text="${jieReply.creator.userGrade.gradeName}">VIP3</i>
                </a>
                
                <span th:if="${jie.creator.id == jieReply.creator.id}">(楼主)</span>
                <span style="color:#5FB878">(管理员)</span>
                <span style="color:#FF9E3F">（社区之光）</span>
                <span style="color:#999">（该号已被封）</span>
              </div>

              <div class="detail-hits">
                <span th:text="${#dates.format(jieReply.gmtCreate,'yyyy-MM-dd HH:mm')}">2017-11-30</span>
              </div>

              <i class="iconfont icon-caina" title="最佳答案"></i>
            </div>
            <div class="detail-body jieda-body photos" th:text="${jieReply.content}"></div>
            <div class="jieda-reply">
              <span class="jieda-zan zanok" type="zan">
                <i class="iconfont icon-zan"></i>
                <em th:text="${jieReply.likeCount}">66</em>
              </span>
              <span type="reply">
                <i class="iconfont icon-svgmoban53"></i>
                回复
              </span>
              <div class="jieda-admin">
                <span type="edit">编辑</span>
                <span type="del">删除</span>
                 <span class="jieda-accept" type="accept">采纳</span>
              </div>
            </div>
          </li>
          
          <!-- 无数据时 -->
           <li class="fly-none" th:if="${#lists.size(jieReplies) < 1}">消灭零回复</li>
        </ul>
        
        <div class="layui-form layui-form-pane">
          <form id="jie-reply">
            <div class="layui-form-item layui-form-text">
              <a name="comment"></a>
              <div class="layui-input-block">
                <textarea id="L_content" name="content" required lay-verify="required" placeholder="请输入内容"  class="layui-textarea fly-editor" style="height: 150px;"></textarea>
              </div>
            </div>
            <div class="layui-form-item">
              <input type="hidden" name="jid" th:value="${jie.id}">
              <button class="layui-btn" lay-filter="jie-reply" lay-submit>提交回复</button>
            </div>
          </form>
        </div>
      </div>
    </div>
    <div class="layui-col-md4">
      <dl class="fly-panel fly-list-one">
        <dt class="fly-panel-title">本周热议</dt>
        <dd>
          <a href="">基于 layui 的极简社区页面模版</a>
          <span><i class="iconfont icon-pinglun1"></i> 16</span>
        </dd>
        <!-- 无数据时 -->
        <!--
        <div class="fly-none">没有相关数据</div>
        -->
      </dl>

      <div class="fly-panel">
        <div class="fly-panel-title">
          这里可作为广告区域
        </div>
        <div class="fly-panel-main">
          <a href="http://layim.layui.com/?from=fly" target="_blank" class="fly-zanzhu" time-limit="2017.09.25-2099.01.01" style="background-color: #5FB878;">LayIM 3.0 - layui 旗舰之作</a>
        </div>
      </div>

      <div class="fly-panel" style="padding: 20px 0; text-align: center;">
        <img src="../../res/images/weixin.jpg" style="max-width: 100%;" alt="layui">
        <p style="position: relative; color: #666;">微信扫码关注 layui 公众号</p>
      </div>

    </div>
  </div>
</div>

<div th:replace="common/footer::bbsFooter"></div>

<script th:src="@{/res/layui/layui.js}"></script>
<script th:src="@{/res/js/column.js}"></script>
<script th:src="@{/res/mods/getUrlParam.js}"></script>
<script>
layui.cache.page = 'jie';
layui.cache.user = {
  username: '游客'
  ,uid: -1
  ,avatar: '../../res/images/avatar/00.jpg'
  ,experience: 83
  ,sex: '男'
};
layui.config({
  version: "3.0.0"
  ,base: '../../res/mods/'
}).extend({
  fly: 'index'
}).use(['fly', 'face'], function(){
  var $ = layui.$
  ,fly = layui.fly;
  //如果你是采用模版自带的编辑器，你需要开启以下语句来解析。
  $('.detail-body').each(function(){
    var othis = $(this), html = othis.html();
    othis.html(fly.content(html));
  });
});
</script>

</body>
</html>